1. Field of the Invention
The present invention relates to a semiconductor device having a microprocessor (abbreviated as MPU hereinafter) and a plurality of peripheral devices controlled by the microprocessor like a one-chip microcomputer.
2. Description of the Prior Art
FIG. 19 is a block diagram of an example of the whole configuration of a general one-chip microcomputer. In the figure, reference numeral 1 designates an MPU, 2-4 various types of peripheral devices A to C controlled by the MPU 1, 5 an interrupt control unit (abbreviated as ICU) for controlling interrupt request signals IRQA to IRQC from the peripheral devices 2 to 4 for supply to the MPU 1, 6a a data bus for exchanging data between the MPU 1 and the peripheral devices 2 to 4 and between the MPU 1 and the interrupt control unit 5, and 6b an address bus for exchanging data between the MPU 1 and the peripheral devices 2 to 4 and between the MPU 1 and the ICU 5. The peripheral devices 2 to 4 are connected to respective external terminals A to C.
The operation of the semiconductor device will be described hereafter.
Suppose that the peripheral device (A) 2 is an event counter which counts the internal clock of the microcomputer only during the input of "H" to the external terminal Ain, generates an interrupt request signal IRQA when a count value of the internal clock of the microcomputer reaches a certain value, and clears a count value during the input of "L" to the external terminal Ain. Also suppose that the peripheral device (B) 3 is a one-shot timer which starts counting in response to a start instruction provided from the MPU 1 through the data bus 6a, outputs a one-shot pulse from the external terminal Bout for a predetermined period of time, and generates an interrupt request signal IRQB after the completion of output. Also suppose that the peripheral device (C) 4 is an A/D converter which converts analog inputs from the external terminal C into digital values. Take the case when the peripheral devices have the above-mentioned functions and are controlled in such a way that the one-shot timer 3 is activated when the input of the terminal Ain is maintained at "H" for more than a predetermined period of time, and an analog value of the terminal C is measured after the completion of one-shot output.
FIG. 20 illustrates the operation of each of the peripheral devices and the waveforms of the terminals Ain and Bout. The figure illustrates the case where noise is generated at the terminal Ain. (It can be said that the event counter is used to cut off noise.) To cut off such noise, the event counter 2 is used to determine whether or not an input pulse is beyond a certain level by detecting whether the event counter 2 reaches a predetermined count value. The result of this decision is taken out as the interrupt request signal IRQA. Thereafter, ICU processing and interrupt processing are performed to activate the one-shot timer 3 by means of the MPU 1. The one-shot timer 3 generates an interrupt request signal IRQB after output of a one-shot pulse. Afterwards, ICU processing and interrupt processing are performed to activate the A/D converter 4 by means of the MPU 1 for A/D conversion.
At this time, the terminal Ain is used for the input of external events, but the terminal Aout is not used. The terminal Bin can be used for the input of a clock to the one-shot timer 3, but may not be used when the internal clock of the microcomputer is inputted.
In most cases, the above-mentioned interrupt request signals are used as control information from the peripheral devices of the conventional semiconductor device, and control information to the peripheral devices is signals from the input terminals or instructions from the MPU in most cases. Furthermore, the MPU must be used to exchange control information between the peripheral devices in many cases, with the result of lowered processing speed of the main program of the MPU and lowered response speed. It is conceivable to exchange control information by interconnecting the input and output terminals of the peripheral devices, but this makes it difficult to change the interconnection of the peripheral devices. Moreover, the semiconductor device incorporates a large number of the above-mentioned peripheral devices for many application purposes in most cases. However, although all the terminals are not required for each application purpose, for example, when a timer clock is not inputted from the external terminal, the semiconductor device requires every possible terminal.
In other words, the peripheral functions of a conventional one-chip microcomputer are fixed and are programmable themselves, but their relationships with other peripheral functions are fixed. This is a general method to provide optimum peripheral functions to as small a chip as possible in order to achieve high cost effectiveness. However, it is conceived from the future trends of one-chip microcomputer and process technologies that a large number of peripheral functions will be integrated into one chip. Then, it is obvious that conventional fixed peripheral functions will increase chip development term and costs because of a large quantity, and that multi-type, small-quantity custom-made production will not be able to achieve satisfactory cost effectiveness. Therefore, it is necessary to take consideration so that a single chip can be used for many application purposes with ease.